Skip to content

STM32L475VG-DISCOVERY-IOT : add general demo #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2017

Conversation

VVESTM
Copy link
Contributor

@VVESTM VVESTM commented Oct 2, 2017

First demo on STM32L475VG-DISCOVERY-IOT board.
Demo is using those components :

  • Low energy Bluetooth (SPBTLE_RF)
  • temperature and pressure sensor (LPS22HB)
  • temperature and humidity sensor (HTS221)
  • Time Of Flight sensor (VL53L0X)

/* Configure SPI3 for BLE
MOSI: PC12 (44), MISO: PC11 (43), SCLK: PC10 (42)
*/
SPIClass SPI_3(44, 43, 42);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use PXn instead of pin numbering when higher than 15 (arduino header D0-D15).

/* Configure BTLE pins
csPin = PD13 (50), spiIRQ = PE6 (57), reset = PA8 (31), led = LED4
*/
SPBTLERFClass BTLE(&SPI_3, 50, 57, 31, LED4);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

VL53L0X *sensor_vl53l0x;

TwoWire *dev_i2c;
#define I2C2_SCL D33
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@fpistm
Copy link
Member

fpistm commented Oct 4, 2017

This PR needs to have I2C using IT. See stm32duino/Arduino_Core_STM32#123

@VVESTM VVESTM force-pushed the STM32L475VG-DISCOVERY-IOT branch from b66ee2c to 3fd8773 Compare October 4, 2017 13:07
@VVESTM VVESTM requested review from LMESTM and a user October 9, 2017 12:14
@@ -0,0 +1,427 @@
/*

BTLE_sensors_tof_demo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what means tof ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Time Of Flight.
Perhaps I need to rename the demo file. I can use BTLE_sensors_demo.ino as the Time Of Flight is "just" a sensor...

This sketch provides a default demo to be used on STMicroelectronics Discovery L475VG IoT board.
It will use several components of the board :
* Low energy Bluetooth (SPBTLE_RF)
* temperature and pressure sensor (LPS22HB)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use upper case or low case in a consistent way for all lines

http://www.st.com/en/evaluation-tools/b-l475e-iot01a.html

This sketch will launch 3 services on BLE : Acc, Environnemental and Time.
For testing the sketch, you can download on the playstore the "BlueNRG" application provided by
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can => you need to download BlueNRG application from playstore

For testing the sketch, you can download on the playstore the "BlueNRG" application provided by
STMicroelectronics. (https://play.google.com/store/apps/details?id=com.st.blunrg for Android or
https://itunes.apple.com/fr/app/bluenrg/id705873549?mt=8 for Apple)
Enable Bluetooth and launch the application on your smartphone. Connect it to the BLueNRG device.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIrst need to compile and download the example to the STM32 board right ?
No other action on the board before you can find the device in the application ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, need to compile and download... of course ;)
No other action needed on the board. (Except move in front of the vl53l0x sensor to move the cube.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just would be good to mention it to know what needs to be started first

#include <tof_gestures_TAP_1.h>

/* Configure SPI3 for BLE
MOSI: PC12 (44), MISO: PC11 (43), SCLK: PC10 (42)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think 42 / 43 /44 values are really useful


void loop() {

BTLE.update();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does BTLE.update ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as official example.

}

if(swipe_detected()){
count_swipe = 20;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explain this hard coded value of 20

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just used to see an effect on the cube. On each swipe detected, we will perform 20 updates of the cube position.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand, but would be worth a comment in the code to explain what it does and what happens if user changes it

if(count_swipe > 0){
switch(axis_to_update){
case UPDATE_AXIS_X:
p_axes->AXIS_X += 100;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explain the 100 value choice

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arbitrary value to move the cube. Same as "official" BTLE example

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again worth a comment .. I think if I ask questions, maybe other users will as well

@@ -1,2 +1,10 @@
# STM32Examples
Provides several examples for the Arduino core for STM32 MCUs.
For the complete description of each example, please refer to the comments at the beginning of each .ino file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the rational but can't we have as well a short description with picture in the example forlder of examples/STM32L475VG-DISCOVERY-IOT ?

Examples for STM32L475VG-DISCOVERY board :
* BTLE_sensors_tof_demo.ino :
* get environmental data and send it via BlueTooth to your smartphone.
* use Time of Flight sensor to detect gestures
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just understood tof means Time of Flight maybe put it here or in the example. Time of Flight (tof)
Or rename to BTLE_sensors_TimeofFligth_demo.ino

@ghost
Copy link

ghost commented Oct 17, 2017

I2C IT mode available in this PR.

@VVESTM VVESTM force-pushed the STM32L475VG-DISCOVERY-IOT branch from af006b4 to 049f6f4 Compare October 17, 2017 16:12
First demo on STM32L475VG-DISCOVERY-IOT board.
Demo is using those components :
   * Low energy Bluetooth (SPBTLE_RF)
   * temperature and pressure sensor (LPS22HB)
   * temperature and humidity sensor (HTS221)
   * Time Of Flight sensor (VL53L0X)
@VVESTM VVESTM force-pushed the STM32L475VG-DISCOVERY-IOT branch from 049f6f4 to a58216d Compare November 14, 2017 14:12
@fpistm fpistm merged commit 4891fb3 into stm32duino:master Nov 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants